$(function(){
    $("#UserRole").bootstrapTable({
        method:"get",
        //请求头部的设置
        contentType: 'application/json',
        url:"/User/find0",
        //设置交替行样式
        striped: true,
        //初始显示页号
        pageNumber: 1,
        //设置表格高度
        //height: 350,
        //是否显示分页
        pagination: true,
        //设置是服务端分页还是客户端分页
        sidePagination: 'server',
        //每页显示的数量
        pageSize: 3,
        //可选每页显示的数量
        pageList: [3, 5, 6, 10],
        //上传到服务端的参数
        queryParams:function(params){
            return{
                pageNum:(params.offset/params.limit)+1,
                pageSize:params.limit,
                userName:$("#uname").val(),
            }
        },
        columns:[
            {title:'编号',field:'userId',align:'center'},
            {title:'账号',field:'userAccount',align:'center'},
            {title:'密码',field:'userPassword',align:'center'},
            {title:'员工姓名',field:'userName',align:'center'},
            {title:'职位',field:'role.roleName',align:'center'},
            {title:'部门',field:'deptId',align:'center',
                formatter:function (value,row,index) {
                    let dept=""
                    if(value==1){
                        dept="产品部"
                        return dept
                    }else if(value==2){
                        dept="生产部"
                        return dept
                    }else {
                        dept='仓管部'
                        return dept
                    }
                }},
        ]
    })
    $("#role_find").click(function(){
        $("#UserRole").bootstrapTable("refresh")
    })
})